

package main;

import aux.NumberPro;

/**
 *
 * @author Yan Couto
 */
public enum Difficulty {
     EASY(2300,1000,7000,7),
     MEDIUM(1000,500,6000,5),
     HARD(500,200,5000,3),
     IMPOSSIBLE(100,100,3000,1),
     CUSTOM(1000,500,6000,5);

     private int timeToShoot;
     private int timeToRadiusIncrease;
     private int timeToGoodShot;
     private int lives;
     Difficulty(int tts,int ttri,int ttgs,int l) {
         timeToShoot = tts;
         timeToRadiusIncrease = ttri;
         timeToGoodShot = ttgs;
         lives = l;
     }

     public int timeToShoot(){
         return timeToShoot;
    }
     
     public int timeToHeart () {
         if(this==IMPOSSIBLE) return -1;
         return NumberPro.random(10000, 30000);
     }

    public int timeToRadiusIncrease () {
        return timeToRadiusIncrease;
    }
    
    public int timeToGoodShot() {
        return timeToGoodShot;
    }
    
    public int lives() {
        return lives;
    }

    public static Difficulty getIndex(int index) {
        for(Difficulty d:Difficulty.values())
            if(d.ordinal()==index)
                return d;
        return null;
    }

     public static Difficulty setCustom(int tts,int ttri,int ttgs,int l) {
         CUSTOM.timeToShoot=tts;
         CUSTOM.timeToRadiusIncrease=ttri;
         CUSTOM.lives = l;
         CUSTOM.timeToGoodShot = ttgs;
         return CUSTOM;
     }
     
    @Override
     public String toString() {
         return "TimeToShoot: " + timeToShoot +
                 "\nTimeToRadiusIncreas: " + timeToRadiusIncrease +
                 "\nTimeToGoodShot: " + timeToGoodShot +
                 "\nLives: " + lives +
                 "\nName: " + super.toString() + "\n\n";
     }
 }